from django import template
from django.conf import settings
from django.core.cache import cache
register = template.Library()

def getPay(pay):
    # return pay
    rate = int(cache.get('rate') * 10000)
    if pay.find('-') > 0:
        return str(int(pay.split('-')[0]) * rate) + '-' + str(int(pay.split('-')[1]) * rate)
    else:
        return int(pay) * rate

register.filter("getPay", getPay)
